module.exports = app => {
    const mongoose = app.mongoose;
    const Schema = mongoose.Schema;

    const UserSchema = new Schema({
        userName: { type: String },
        passWord: { type: String },
        iconUrl: { type: String },
        wxId: { type: String }, //UnionID
        phoneId: { type: String },
        gameId: { type: String },
        role: { type: Number, default: 100 },
        createTime: { type: Date, default: Date.now },
        updateTime: { type: Date, default: Date.now }
    }, {
        timestamps: { createdAt: 'createTime', updatedAt: 'updateTime' }
    });

    return mongoose.model('User', UserSchema);
}